#!/usr/bin/env python

from dynamic_reconfigure.parameter_generator_catkin import *

PKG = "video_stream_opencv"

gen = ParameterGenerator()


class LEVEL:
    NORMAL = 0
    RUNNING = 1


#       name    type     level     description     default      min      max
gen.add("camera_name", str_t, LEVEL.NORMAL, "Camera name", "camera")
gen.add("set_camera_fps", double_t, LEVEL.RUNNING, "Image Publish Rate", 30.0, 0.0, 1000.0)
gen.add("buffer_queue_size", int_t, LEVEL.NORMAL, "Buffer size for capturing frames", 100, 1, 1000)
gen.add("fps", double_t, LEVEL.RUNNING, "Image Publish Rate", 240.0, 0.0, 1000.0)
gen.add("frame_id", str_t, LEVEL.RUNNING, "Camera FrameID", "camera")
gen.add("camera_info_url", str_t, LEVEL.RUNNING, "Camera info URL", "")
gen.add("flip_horizontal", bool_t, LEVEL.NORMAL, "Flip image horizontally", False)
gen.add("flip_vertical", bool_t, LEVEL.NORMAL, "Flip image vertically", False)
gen.add("width", int_t, LEVEL.RUNNING, "Target width", 0, 0, 10000)
gen.add("height", int_t, LEVEL.RUNNING, "Target height", 0, 0, 10000)
gen.add("brightness", double_t, LEVEL.RUNNING, "Target brightness", 0.5019607843137255, 0.0, 1.0)
gen.add("contrast", double_t, LEVEL.RUNNING, "Target contrast", 0.12549019607843137, 0.0, 1.0)
gen.add("hue", double_t, LEVEL.RUNNING, "Target hue", 0.5, 0.0, 1.0)
gen.add("saturation", double_t, LEVEL.RUNNING, "Target saturation", 0.64, 0.0, 1.0)
gen.add("auto_exposure", bool_t, LEVEL.RUNNING, "Target auto exposure", True)
gen.add("exposure", double_t, LEVEL.RUNNING, "Target exposure", 0.5, 0.0, 1.0)
gen.add("loop_videofile", bool_t, LEVEL.RUNNING, "Loop videofile", False)
gen.add("reopen_on_read_failure", bool_t, LEVEL.RUNNING, "Re-open camera device on read failure", False)
gen.add("output_encoding", str_t, LEVEL.NORMAL, "Output encoding", "bgr8")
gen.add("start_frame", int_t, LEVEL.RUNNING, "Start frame of the video ", 0, 0)
gen.add("stop_frame", int_t, LEVEL.RUNNING, "Stop frame of the video", -1, -1)

exit(gen.generate(PKG, PKG, "VideoStream"))
